<template>
  <el-table
    :data="tableData"
    border
    max-height="540"
    style="width: 100%">
    <el-table-column
      prop="c_no"
      label="课程编号">
    </el-table-column>
    <el-table-column
      prop="c_semeter"
      label="学年">
    </el-table-column>
    <el-table-column
      prop="c_title"
      label="课程名称">
    </el-table-column>
    <el-table-column
      prop="c_type"
      label="课程类型">
    </el-table-column>
    <el-table-column
      prop="t_name"
      label="授课老师">
    </el-table-column>
    <el-table-column
      prop="class_no"
      label="授课班级">
    </el-table-column>
  </el-table>
</template>

<script>
import { allcourseAPI } from '@/api/userAPI.js'

export default {
  name: 'Allcourse',
  data () {
    return {
      tableData: []
    }
  },
  created () {
    this.getTableData()
  },
  methods: {
    // 获取表格数据
    async getTableData () {
      const { data: res } = await allcourseAPI()
      if (res.status !== 200) return this.$message.error(res.data.msg)
      this.tableData = res.data
    }
  }
}
</script>

<style>

</style>
